home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / CIncludes / Windows.h < prev   
Encoding:
C/C++ Source or Header  |  1992-01-29  |  7.8 KB  |  297 lines  |  [TEXT/MPS ]

  1.  
  2. /************************************************************
  3.  
  4. Created: Sunday, September 15, 1991 at 9:32 PM
  5.  Windows.h
  6.  C Interface to the Macintosh Libraries
  7.  
  8.  
  9.   Copyright Apple Computer, Inc. 1985-1991
  10.   All rights reserved.
  11.  
  12. ************************************************************/
  13.  
  14.  
  15. #ifndef __WINDOWS__
  16. #define __WINDOWS__
  17.  
  18. #ifndef __QUICKDRAW__
  19. #include <Quickdraw.h>
  20. #endif
  21.  
  22. #ifndef __EVENTS__
  23. #include <Events.h>
  24. #endif
  25.  
  26. #ifndef __CONTROLS__
  27. #include <Controls.h>
  28. #endif
  29.  
  30.  
  31. enum {
  32.  
  33.  documentProc = 0,
  34.  dBoxProc = 1,
  35.  plainDBox = 2,
  36.  altDBoxProc = 3,
  37.  noGrowDocProc = 4,
  38.  movableDBoxProc = 5,
  39.  zoomDocProc = 8,
  40.  zoomNoGrow = 12,
  41.  rDocProc = 16,
  42.  dialogKind = 2,
  43.  userKind = 8,
  44.  
  45. /*FindWindow Result Codes*/
  46.  inDesk = 0,
  47.  inMenuBar = 1,
  48.  inSysWindow = 2,
  49.  inContent = 3,
  50.  inDrag = 4,
  51.  inGrow = 5,
  52.  inGoAway = 6,
  53.  inZoomIn = 7,
  54.  inZoomOut = 8
  55. };
  56. enum {
  57.  
  58. /*window messages*/
  59.  wDraw = 0,
  60.  wHit = 1,
  61.  wCalcRgns = 2,
  62.  wNew = 3,
  63.  wDispose = 4,
  64.  wGrow = 5,
  65.  wDrawGIcon = 6,
  66.  
  67. /*defProc hit test codes*/
  68.  wNoHit = 0,
  69.  wInContent = 1,
  70.  wInDrag = 2,
  71.  wInGrow = 3,
  72.  wInGoAway = 4,
  73.  wInZoomIn = 5,
  74.  wInZoomOut = 6,
  75.  deskPatID = 16,
  76.  
  77. /*Window Part Identifiers which correlate color table entries with window elements*/
  78.  wContentColor = 0,
  79.  wFrameColor = 1,
  80.  wTextColor = 2,
  81.  wHiliteColor = 3,
  82.  wTitleBarColor = 4
  83. };
  84.  
  85.  
  86. typedef pascal void (*DragGrayRgnProcPtr)(void);
  87.  
  88. struct WindowRecord {
  89.  GrafPort port;
  90.  short windowKind;
  91.  Boolean visible;
  92.  Boolean hilited;
  93.  Boolean goAwayFlag;
  94.  Boolean spareFlag;
  95.  RgnHandle strucRgn;
  96.  RgnHandle contRgn;
  97.  RgnHandle updateRgn;
  98.  Handle windowDefProc;
  99.  Handle dataHandle;
  100.  StringHandle titleHandle;
  101.  short titleWidth;
  102.  ControlHandle controlList;
  103.  struct WindowRecord *nextWindow;
  104.  PicHandle windowPic;
  105.  long refCon;
  106. };
  107.  
  108. typedef struct WindowRecord WindowRecord;
  109. typedef WindowRecord *WindowPeek;
  110.  
  111. struct CWindowRecord {
  112.  CGrafPort port;
  113.  short windowKind;
  114.  Boolean visible;
  115.  Boolean hilited;
  116.  Boolean goAwayFlag;
  117.  Boolean spareFlag;
  118.  RgnHandle strucRgn;
  119.  RgnHandle contRgn;
  120.  RgnHandle updateRgn;
  121.  Handle windowDefProc;
  122.  Handle dataHandle;
  123.  StringHandle titleHandle;
  124.  short titleWidth;
  125.  ControlHandle controlList;
  126.  struct CWindowRecord *nextWindow;
  127.  PicHandle windowPic;
  128.  long refCon;
  129. };
  130.  
  131. typedef struct CWindowRecord CWindowRecord;
  132. typedef CWindowRecord *CWindowPeek;
  133.  
  134. struct WStateData {
  135.  Rect userState;                /*user state*/
  136.  Rect stdState;                    /*standard state*/
  137. };
  138.  
  139. typedef struct WStateData WStateData;
  140. typedef WStateData *WStateDataPtr, **WStateDataHandle;
  141.  
  142. struct AuxWinRec {
  143.  struct AuxWinRec **awNext;        /*handle to next AuxWinRec*/
  144.  WindowPtr awOwner;                /*ptr to window */
  145.  CTabHandle awCTable;            /*color table for this window*/
  146.  Handle dialogCItem;            /*handle to dialog manager structures*/
  147.  long awFlags;                    /*reserved for expansion*/
  148.  CTabHandle awReserved;            /*reserved for expansion*/
  149.  long awRefCon;                    /*user Constant*/
  150. };
  151.  
  152. typedef struct AuxWinRec AuxWinRec;
  153. typedef AuxWinRec *AuxWinPtr, **AuxWinHandle;
  154.  
  155. struct WinCTab {
  156.  long wCSeed;                    /*reserved*/
  157.  short wCReserved;                /*reserved*/
  158.  short ctSize;                    /*usually 4 for windows*/
  159.  ColorSpec ctTable[5];
  160. };
  161.  
  162. typedef struct WinCTab WinCTab;
  163. typedef WinCTab *WCTabPtr, **WCTabHandle;
  164.  
  165.  
  166. #ifdef __cplusplus
  167. extern "C" {
  168. #endif
  169. pascal void InitWindows(void)
  170.  = 0xA912; 
  171. pascal void GetWMgrPort(GrafPtr *wPort)
  172.  = 0xA910; 
  173. pascal WindowPtr NewWindow(void *wStorage,const Rect *boundsRect,ConstStr255Param title,
  174.  Boolean visible,short theProc,WindowPtr behind,Boolean goAwayFlag,long refCon)
  175.  = 0xA913; 
  176. pascal WindowPtr GetNewWindow(short windowID,void *wStorage,WindowPtr behind)
  177.  = 0xA9BD; 
  178. pascal void CloseWindow(WindowPtr theWindow)
  179.  = 0xA92D; 
  180. pascal void DisposeWindow(WindowPtr theWindow)
  181.  = 0xA914; 
  182. void setwtitle(WindowPtr theWindow,char *title); 
  183. pascal void GetWTitle(WindowPtr theWindow,Str255 title)
  184.  = 0xA919; 
  185. pascal void SelectWindow(WindowPtr theWindow)
  186.  = 0xA91F; 
  187. pascal void HideWindow(WindowPtr theWindow)
  188.  = 0xA916; 
  189. pascal void ShowWindow(WindowPtr theWindow)
  190.  = 0xA915; 
  191. pascal void ShowHide(WindowPtr theWindow,Boolean showFlag)
  192.  = 0xA908; 
  193. pascal void HiliteWindow(WindowPtr theWindow,Boolean fHilite)
  194.  = 0xA91C; 
  195. pascal void BringToFront(WindowPtr theWindow)
  196.  = 0xA920; 
  197. pascal void SendBehind(WindowPtr theWindow,WindowPtr behindWindow)
  198.  = 0xA921; 
  199. pascal WindowPtr FrontWindow(void)
  200.  = 0xA924; 
  201. pascal void DrawGrowIcon(WindowPtr theWindow)
  202.  = 0xA904; 
  203. pascal void MoveWindow(WindowPtr theWindow,short hGlobal,short vGlobal,
  204.  Boolean front)
  205.  = 0xA91B; 
  206. pascal void SizeWindow(WindowPtr theWindow,short w,short h,Boolean fUpdate)
  207.  = 0xA91D; 
  208. pascal void ZoomWindow(WindowPtr theWindow,short partCode,Boolean front)
  209.  = 0xA83A; 
  210. pascal void InvalRect(const Rect *badRect)
  211.  = 0xA928; 
  212. pascal void InvalRgn(RgnHandle badRgn)
  213.  = 0xA927; 
  214. pascal void ValidRect(const Rect *goodRect)
  215.  = 0xA92A; 
  216. pascal void ValidRgn(RgnHandle goodRgn)
  217.  = 0xA929; 
  218. pascal void BeginUpdate(WindowPtr theWindow)
  219.  = 0xA922; 
  220. pascal void EndUpdate(WindowPtr theWindow)
  221.  = 0xA923; 
  222. pascal void SetWRefCon(WindowPtr theWindow,long data)
  223.  = 0xA918; 
  224. pascal long GetWRefCon(WindowPtr theWindow)
  225.  = 0xA917; 
  226. pascal void SetWindowPic(WindowPtr theWindow,PicHandle pic)
  227.  = 0xA92E; 
  228. pascal PicHandle GetWindowPic(WindowPtr theWindow)
  229.  = 0xA92F; 
  230. pascal Boolean CheckUpdate(EventRecord *theEvent)
  231.  = 0xA911; 
  232. pascal void ClipAbove(WindowPeek window)
  233.  = 0xA90B; 
  234. pascal void SaveOld(WindowPeek window)
  235.  = 0xA90E; 
  236. pascal void DrawNew(WindowPeek window,Boolean update)
  237.  = 0xA90F; 
  238. pascal void PaintOne(WindowPeek window,RgnHandle clobberedRgn)
  239.  = 0xA90C; 
  240. pascal void PaintBehind(WindowPeek startWindow,RgnHandle clobberedRgn)
  241.  = 0xA90D; 
  242. pascal void CalcVis(WindowPeek window)
  243.  = 0xA909; 
  244. pascal void CalcVisBehind(WindowPeek startWindow,RgnHandle clobberedRgn)
  245.  = 0xA90A; 
  246. pascal long GrowWindow(WindowPtr theWindow,Point startPt,const Rect *bBox)
  247.  = 0xA92B; 
  248. Boolean trackgoaway(WindowPtr theWindow,Point *thePt); 
  249. pascal short FindWindow(Point thePoint,WindowPtr *theWindow)
  250.  = 0xA92C; 
  251. short findwindow(Point *thePoint,WindowPtr *theWindow); 
  252. pascal long PinRect(const Rect *theRect,Point thePt)
  253.  = 0xA94E; 
  254. pascal long DragGrayRgn(RgnHandle theRgn,Point startPt,const Rect *boundsRect,
  255.  const Rect *slopRect,short axis,DragGrayRgnProcPtr actionProc)
  256.  = 0xA905; 
  257. pascal Boolean TrackBox(WindowPtr theWindow,Point thePt,short partCode)
  258.  = 0xA83B; 
  259. pascal void GetCWMgrPort(CGrafPtr *wMgrCPort)
  260.  = 0xAA48; 
  261. void getwtitle(WindowPtr theWindow,char *title); 
  262. pascal void SetWinColor(WindowPtr theWindow,WCTabHandle newColorTable)
  263.  = 0xAA41; 
  264. pascal Boolean GetAuxWin(WindowPtr theWindow,AuxWinHandle *awHndl)
  265.  = 0xAA42; 
  266. long growwindow(WindowPtr theWindow,Point *startPt,const Rect *bBox); 
  267. pascal void SetDeskCPat(PixPatHandle deskPixPat)
  268.  = 0xAA47; 
  269. WindowPtr newwindow(void *wStorage,const Rect *boundsRect,char *title,Boolean visible,
  270.  short theProc,WindowPtr behind,Boolean goAwayFlag,long refCon); 
  271. pascal WindowPtr NewCWindow(void *wStorage,const Rect *boundsRect,ConstStr255Param title,
  272.  Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon)
  273.  = 0xAA45; 
  274. WindowPtr newcwindow(void *wStorage,const Rect *boundsRect,char *title,
  275.  Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon); 
  276. pascal WindowPtr GetNewCWindow(short windowID,void *wStorage,WindowPtr behind)
  277.  = 0xAA46; 
  278. pascal short GetWVariant(WindowPtr theWindow)
  279.  = 0xA80A; 
  280. long pinrect(const Rect *theRect,Point *thePt); 
  281. #define GetGrayRgn() (* (RgnHandle*) 0x09EE)
  282. pascal void SetWTitle(WindowPtr theWindow,ConstStr255Param title)
  283.  = 0xA91A; 
  284. Boolean trackbox(WindowPtr theWindow,Point *thePt,short partCode); 
  285. pascal Boolean TrackGoAway(WindowPtr theWindow,Point thePt)
  286.  = 0xA91E; 
  287. pascal void DragWindow(WindowPtr theWindow,Point startPt,const Rect *boundsRect)
  288.  = 0xA925; 
  289. long draggrayrgn(RgnHandle theRgn,Point *startPt,const Rect *boundsRect,
  290.  const Rect *slopRect,short axis,DragGrayRgnProcPtr actionProc); 
  291. void dragwindow(WindowPtr theWindow,Point *startPt,const Rect *boundsRect); 
  292. #ifdef __cplusplus
  293. }
  294. #endif
  295.  
  296. #endif
  297.